<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>js对象</title>
		<script>
			/*创建对象,设置了一个属性,扩充属性*/
			/*对象方法 (函数)*/
			var person = {
				name:"tony",
				age:18,
				tostring:function(){    /*静态方法,在对象声明时确定*/
					return this.name + this.age;
				}
				};
				
				/*在对象的外部给对象扩充方法*/
				person.toUpperCase = function(){
					return this.name.toUpperCase();
				}
				
				/*动态扩展属性*/
				person.school = "中国人民大学";
				
				console.log(person.name);
				console.log(person.tostring())
				console.log(person.toUpperCase())
			
			/*调用对象*/
			/*alert(person);
			alert(person.name);
			alert(person.age);*/
			console.log(person);
			console.table(person);
		</script>
	</head>
	<body>
	</body>
</html>
